package crypto;

import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;

public class GeneraChiavi {
	private int seme=0;
	private PublicKey chiavePubblica;
	private PrivateKey chiavePrivata;
	public GeneraChiavi() throws NoSuchAlgorithmException{
		KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
		kpg.initialize(1024);
		KeyPair kp = kpg.generateKeyPair();
		chiavePubblica=kp.getPublic();
		chiavePrivata=kp.getPrivate();
	}
	
	public PublicKey getPublic(){
		return chiavePubblica;
	}
	
	public PrivateKey getPrivate(){
		return chiavePrivata;
	}
}

